using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using emp.BLL;

public partial class crm_quest_QuestionOptionDel : System.Web.UI.Page
{
    private int qsd_id;
    private int number;    
    protected void Page_Load(object sender, EventArgs e)
    {
        qsd_id = Int32.Parse(Request.Params["mcd_uid"]);
        number = Int32.Parse(Request.Params["number"]);
       // questionoptiondel(qsd_id, number);
        if (iscandel(qsd_id))
        {
            string URL_QUESTOPTION = "QuestionOptionList.aspx?QSD_ID=" + qsd_id + "&page=" + Request.Params["cur_page"] + "&cur_page=" + Request["page"] + "";
            questionoptiondel(qsd_id, number);
            HttpContext.Current.Response.Redirect(URL_QUESTOPTION);
        }
        else
        {
            string URL_QUESTOPTION = "QuestionOptionList.aspx?QSD_ID=" + qsd_id + "&page=" + Request.Params["cur_page"] + "&cur_page=" + Request["page"] + "&state=1";
        //    questionoptiondel(qsd_id, number);
            HttpContext.Current.Response.Redirect(URL_QUESTOPTION);
        
           
        }
    }

    void questionoptiondel(int qsd_id, int number)
    {
        Quest qt = new Quest();
        qt.QuestionOptionDel(qsd_id, number);
    }

    Boolean iscandel(int qsd_id)
    {
        Boolean returnvalue = false;
        Quest qt = new Quest();
        returnvalue = qt.isQuestionOptionCanDel(qsd_id);
        return returnvalue;
    }
}
